import request from '@/sheep/request';

export default {
    // 项目：列表接口
    projectList: (params) =>
    request({
      url: '/api/project/index',
      method: 'GET',
      custom: {
        auth: true,
      },
      params
    }),

    // 项目：作废接口
    scheduleCancel:(params) => 
    request({
      url: 'api/schedule/cancel',
      method: 'GET',
      params,
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
    }),

  // 项目：排班接口
    scheduleAdd: (data) => 
    request({
      url: '/api/schedule/add',
      method: 'POST',
      custom: {
        auth: true,
        showSuccess: true
      },
      data
    }),
    getScheduleList:(params) => 
    request({
      url: '/api/schedule/index',
      method: 'GET',
      custom: {
        auth: true,
        showSuccess: false
      },
      params
    }),
    // 项目详情
        getScheduleView: (params) =>
          request({
            url: 'api/schedule/view',
            method: 'GET',
            params,
            custom: {
              showSuccess: false,
              successMsg: '',
              showError: false,
              errorMsg: '',
              showLoading: false,
              loadingMsg: '加载中',
              auth: true,
            },
          }),
    //任务列表
    getScheduleTaskList:(params) => 
      request({
        url: '/api/schedule/task_list',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
    // 我的接单任务列表/任务已接单所有人员列表
    getScheduleTaskIndex:(params) => 
      request({
        url: '/api/schedule_apply/index',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
      //立即接单
    scheduleApplyAdd:(params) => 
      request({
        url: '/api/schedule_apply/add',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
      // 加入排班（用户扫码）
      postScheduleUserAdd:(params) => 
        request({
          url: '/api/schedule_user/add',
          method: 'POST',
          custom: {
            showSuccess: false,
            successMsg: '',
            showError: false,
            errorMsg: '',
            showLoading: false,
            loadingMsg: '加载中',
            auth: true,
          },
          params
        }),
        //排班详情（排班的人员列表）
        getScheduleUserIndex:(params) => 
          request({
            url: '/api/schedule_user/index',
            method: 'GET',
            custom: {
              showSuccess: false,
              successMsg: '',
              showError: false,
              errorMsg: '',
              showLoading: false,
              loadingMsg: '加载中',
              auth: true,
            },
            params
          }),   
          //排班打卡（批量打卡）
          postScheduleAttendanceBatchPunch:(params) => 
            request({
              url: '/api/schedule_attendance/batch_punch',
              method: 'POST',
              custom: {
                showSuccess: false,
                successMsg: '',
                showError: true,
                errorMsg: '',
                showLoading: false,
                loadingMsg: '加载中',
                auth: true,
              },
              params
            }),
         //排班打卡（批量打卡）
         postScheduleAttendanceAdd:(params) => 
          request({
            url: '/api/schedule_attendance/add',
            method: 'POST',
            custom: {
              showSuccess: false,
              successMsg: '',
              showError: true,
              errorMsg: '',
              showLoading: true,
              loadingMsg: '加载中',
              auth: true,
            },
            params
          }),
//移除人员
postScheduleUserDel:(params) => 
  request({
    url: '/api/schedule_user/del',
    method: 'POST',
    custom: {
      showSuccess: false,
      successMsg: '',
      showError: true,
      errorMsg: '',
      showLoading: false,
      loadingMsg: '加载中',
      auth: true,
    },
    params
  }),
  //移除人员
postScheduleUserEdit:(params) => 
  request({
    url: '/api/schedule_user/edit',
    method: 'POST',
    custom: {
      showSuccess: false,
      successMsg: '',
      showError: true,
      errorMsg: '',
      showLoading: false,
      loadingMsg: '加载中',
      auth: true,
    },
    params
  }),
  // 获取用户是否报名
  postScheduleUserApply:(params) => 
    request({
      url: '/api/schedule_user/get_user_is_apply',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
      // 获取用户打卡信息
  postScheduleUserAttendance:(params) => 
    request({
      url: '/api/schedule_attendance/get_user_attendance',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
          // 一键打款
  postScheduleUserRemit:(params) => 
    request({
      url: '/api/schedule_remit/remit',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
   // 获取用户打卡信息
  postScheduleIndex:(params) => 
    request({
      url: '/api/schedule_attendance/index',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
       // 发薪记录
 getRemitList:(params) => 
    request({
      url: '/api/schedule/get_remit_list',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
    // 发薪记录 （用户查看自己的记录）
    getRemitListUser:(params) => 
      request({
        url: '/api/schedule_remit/get_remit_list_by_userid',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
   // （员工端）获取已发薪排班记录
   getRemitListDepartmentid:(params) => 
    request({
      url: '/api/schedule/get_remit_list_by_departmentid',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
    // （员工端）发薪记录（主订单）
    getSchedule_remitIndex:(params) => 
    request({
      url: '/api/schedule_remit/index',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
       // （员工端）获取已发薪人员记录
   getRemitUserlistRemitid:(params) => 
    request({
      url: '/api/schedule_remit/get_remit_userlist_by_remitid',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
// 发薪审批列表
    getRemitApproveList:(params) => 
      request({
        url: '/api/schedule_remit/approve_list',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
  // 发薪通过
  getRemitApprovePass:(params) => 
    request({
      url: '/api/schedule_remit/pass',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
    // 发薪拒绝
    getRemitApproveRefuse:(params) => 
      request({
        url: '/api/schedule_remit/refuse',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
    // 发薪详情
    getRemitApproveView:(params) => 
      request({
        url: '/api/schedule_remit/view',
        method: 'GET',
        custom: {
          showSuccess: false,
          successMsg: '',
          showError: true,
          errorMsg: '',
          showLoading: false,
          loadingMsg: '加载中',
          auth: true,
        },
        params
      }),
  // 修改金额（代理商金额和项目负责人金额）
  postScheduleEdit:(params) => 
    request({
      url: '/api/schedule/edit',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),

   // 入职/合同签署
   postDispatchAdd:(params) => 
    request({
      url: '/api/dispatch/add',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
    // 重新发薪
    postAgainRemit:(params) => 
    request({
      url: '/api/schedule_remit/again_remit',
      method: 'POST',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: true,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),  // 导出排班所有用户
   GETUserlistScheduleid:(params) => 
    request({
      url: '/api/schedule_user/export_userlist_by_scheduleid',
      method: 'GET',
      custom: {
        showSuccess: false,
        successMsg: '',
        showError: false,
        errorMsg: '',
        showLoading: false,
        loadingMsg: '加载中',
        auth: true,
      },
      params
    }),
	}